Logistic Rgrssion Logistic Rgrssion Risk Fctor Bnzn Odds Rtio Rviw Outcom Brin Tumor Ys Cs No Control Totl Ys 5 2 7 No 3 23 Totl 5 5 3 2 Risk Fctor Odds Rtio Rviw Ys Diss Outcom No No Diss Totl : robbility of succss diss in row - : robbility of filur no diss in row Risk fctor vribl = Th odds of gtting diss for th ol who wr osd to th risk fctor: Ys Eosd No Unosd c + c b d b + d Totl + b c + d n 3 O + = diss osd] diss osd] - diss osd] no diss osd] c c c c 5 2 4 : robbility of succss diss in row 2 : robbility of filur no diss in row 2 Risk fctor vribl = Th odds of gtting diss for th ol who wr not osd to th risk fctor: diss unosd ] diss unosd ] O = - diss unosd ] no diss unosd ] b b d d b d b d.77 3 5 Th Odds Rtio of hving brin tumor for ol who wr osd to th risk fctor vrsus not osd: O OR O [ / c]/[ c / c] c [ b / b d]/[ d / b d] b d d 53 3.25 bc 2 Intrrttion: Th odds of hving brin tumor r 3.25 tims highr for thos who osd to bnzn thn thos who wr not osd to bnzn. 6 LR -
Logistic Rgrssion Confidnc Intrvl for Odds Rtio: If >, thn th odds of succss r highr for row risk fctor rsnt thn row 2 risk fctor not rsnt. For lrg sml, th log of odds rtio, ln symtoticlly norml distribution., follows If <, thn th odds of succss r lowr for row risk fctor rsnt thn row 2 risk fctor not rsnt. If =, thn th odds of succss r qul for row risk fctor rsnt nd row 2 risk fctor not rsnt. 7 Th % confidnc intrvl stimt for th Log Odds Rtio is ln z / 2 s * Th % confidnc intrvl stimt for th Odds Rtio is ln z 2s* ln z / 2s* /, 8 Confidnc Intrvl for Odds Rtio: whr ln z 2s* ln z / 2s* /, d bc nd, b, c nd d should not b zro., stndrd rror of ln is s* b c d 9 Eml: Brin tumor Th 95% confidnc intrvl stimt for th odds rtio is: z / 2 s* 5 2 ln ln3.25.79, z z.25.96, s*.96.296.58 / 2 ln z / 2s*.79.58,, 3 ln z / 2s*.79.58 d bc 53 3.25, 2.296.89, 5.87.89, 5.87 This confidnc intrvl dosn t covr. In fct, it covrs rng tht is grtr thn. This mns tht whn osd to bnzn n individul is mor likly to hv brin tumor thn thos who wr not osd to bnzn. Continuity Corrction: Th % confidnc intrvl stimt for th Odds Rtio is ln z 2s* ln z / 2s* /, whr.5 d.5, stndrd rror of ln b.5 c.5 is s*.5 b.5 c.5 d.5 2 LR - 2
Logistic Rgrssion Eml: Risk Fctors for Dngu Eidmics Dt: Dnts, Koomn nd Addy t l., Dngu Eidmics on th Pcific Cost of Mico, Intrntionl Journl of Eidmiology 7 988,. 78-86. Vribl Nm Idntifiction Ag Socioconomic Sttus Sctor Diss Sttus Sving Account Sttus -96 Dscrition Ag of rson in yrs = ur, 2 = middl, 3 = lowr Sctor in city: = sctor 2 = sctor 2 = with diss, = no diss = hs ccount, = hs no ccount. 3 With % of th dt: Diss Sttus Ys, Y= No, Y= Sctor X=, sctor 22 95 7 X=, sctor 2 35 44 79 57 39 96 Sctor : = 22/7, = 22/7 = 95/7 Sctor 2: = 35/79, = 35/79 = 44/79 Odds rtio of hving diss for sctor v.s. sctor 2: 22/95/35/44 =.29 Th odds of hving diss living in sctor is round 3% of th odds 4 for living in sctor 2. Logistic Rgrssion Odds rtio of hving diss for sctor v.s. sctor 2: 22/95/35/44 =.29 Th odds of hving diss living in sctor is round 3% of th odds for living in sctor 2. Odds rtio of hving diss for sctor 2 v.s. sctor : 35/44/22/95 = 3.45 Th odds of hving diss living in sctor 2 is mor thn 3 tims of th odds for living in sctor. Logistic rgrssion is rgrssion mthod tht cn modl binry rsons vribl using both quntittiv nd ctgoricl lntory vribls. This mthod cn lso b usd to rdict th robbility of binry outcom. Nottion: Y is th rsons vribl, it tks on if diss rsnt nd tks on if diss bsnt. dnots th robbility of succss i.., robbility of y = diss rsnt or PY= X 5 6 In Siml Linr Rgrssion Rsons vribl is quntittiv In Siml Linr Rgrssion 9 8 y y 7 6 m y :Mn of y t 5 4.5 2. Durtion 3. 3.5 4. 4.5 5. 5.5 2 3 4 7 8 LR - 3
Rsons Vribl Logistic Rgrssion Linr Rgrssion Modl for Quntittiv Rsons Vribl.2. Rsons Vribl is Binry Y = m y +.8.6.4 Modls th mn rsons m y = + X.2. -.2.5..5 2. 3. 9 Elntory Vribl 2 Rgrssion Modls with Binry Outcom Vribl How to modl th robbility of succss? Sinc th outcom is ithr or, it cn b modld by Brnoulli distribution. Y ~ Brnoulli Y Probbility PY = = or PY = X = PY = = or PY = X = Th mn of Brnoulli distribution is th robbility of succss: m y = =???? W wnt to modl th robbility of gtting, or {Y = }, t givn X. 2 Cn w fit lin for nd using linr rgrssion? Problms. Non-norml rror trms: ε 2. Non-constnt rror vrinc: 2 ε.2..8.6.4.2. -.2.5..5 2. Elntory Vribl 3. Constrints of rsons function: μ y = If fitting lin, my cd or bcom ngtiv. Not good. 3. 22 To modl th robbility of succss: To modl th robbility of succss:.2 6 counts of s Fitting Logistic Function Sigmoidl Curv..2.8..6.4.2 4 counts of s.8.6.4.2.. -.2.5..5 2. 3. -.2 Elntory Vribl 23.5..5 2. Elntory Vribl 3. 24 LR - 4
Logistic Rgrssion LR - 5 25 f 26 f 27 Siml Logistic Rsons Function Logistic Function Th robbility of succss robbility of Y = givn : Prortis: Sigmoidl S-shd Monotonic Incrsing or dcrsing Linrizbl Logit trnsformtion 28 Diffrnt form of th logistic function: Logit Trnsformtion Logit link ln Th nturl logrithm of th odds in fvor of succss t : Th logrithm of th odds is linrly rltd to. Logit rsons function 29 Diffrnt form of th Logistic Function Odds Th odds in fvor of succss th odds in fvor of Y= t r Solving for 3 Usful Sttistics:. Prdictd Probbility = Prdictd robbility of succss for = : Prdictd robbility of succss for = : Prdictd robbility of succss: Us th mimum liklihood stimts Pronsity Scor
Logistic Rgrssion Eml: Studying diss nd sctors Modl: ln Sctor within city Ctgoricl Vribls Codings Sctor Sctor 2 Prmt r coding Frquncy 7. 79. 3 St SECTOR Constnt. Vribls ntrd on st : SECTOR. Vribls in th Eqution B S.E. Wld df Sig. EB Lowr Ur -.234.328 4.93..29.53.553 -.229.226.2.32.795 Mimum liklihood stimts:.229, β -. 234 Th rdictd robbility of hving diss cn b clcultd with th rdiction qution.299 95.% C.I.for EXPB.234.299.234 Probbility of gtting diss for ol from sctor : = -.299 -.234 /+ -.299 -.234 =.88343 Probbility of gtting diss for ol from sctor 2: = -.299 /+ -.299 = -.88343 =.896569 32 2. Estimtd Odds Th odds in fvor of succss th odds in fvor of Y= t is: ln =.229.234 Estimtd odds = =.229.234 Th odds of ol in sctor to hv th diss.229.234 =.235 Th odds of ol in sctor 2 to hv th diss.229.234 =.7953 33 3. Estimtd Prmtr nd Odds Rtio ln chng of ln of odds for incrsing on unit of X, tht is ln ln ln = = If X is binry vribl, thn is th odds rtio nd is th stimtd odds rtio for = v.s = 34 Odds rtio of gtting diss for ol from sctor v.s. sctor 2: Odds rtio = =.234 =.29 EB in SPSS Th -vlu of th tst for = OR = is. which is lss thn.5. So sctor vribl is sttisticlly significnt. It suggsts tht thr is som ssocition btwn diss nd sctor. Th 95% conf. intrvl of odds rtio is.53,.553. Odds rtio of hving diss for sctor 2 v.s. sctor would b th rcirocl of.29 nd is 3.45, with 95% C.I..8, 6.54. 35 Studying diss nd sctors, socil con., g, sv. Socioconomic Sttus Sctor within city Ctgoricl Vribls Codings Ur Middl Lowr Sctor Sctor 2 77.. 49.. 7.. 7. Prmtr coding Frquncy 2 79. 36 LR - 6
Logistic Rgrssion SECTOR SCIOSTAT SCIOSTAT SCIOSTAT2 SAVINGS AGE Constnt Odds rtio of contrcting diss for Ur v.s. Lowr Socio. Sttus is.757 Vribls in th Eqution B S.E. Wld df Sig. EB Lowr U -.234.357.97..29.45.5.439 2.83 -.278.434.49.522.757.323.7 -.29.459.227.634.83.327.9.6.386.25.874.63.499 2.2.27.9 8.646.3.27.9. -.84.452 3.246.72.443 Vribls ntrd on st : SECTOR, SCIOSTAT, SAVINGS, AGE. Odds rtio of contrcting diss for Middl v.s. Lowr Socio. Sttus is.83 95.% C.I.for EXP 37 AGE SECTOR Constnt Vribls in th Eqution 95.% C.I.fo B S.E. Wld df Sig. EB Lowr.27.9 9.66.2.27. -.8.337 2.295..37.59 -.978.336 8.458.4.376 Vribls ntrd on st : AGE, SECTOR. Odds rtio of gtting diss for sctor vrsus sctor 2 ftr djustd for g:.37 Odds rtio of gtting diss for sctor 2 vrsus sctor ftr djustd for g: 3.2 = /.37 Th -vlu is. for tsting th significnc of sctor vribl by controlling th g vribl. Sinc -vlu is lss thn.5, thr is sttisticlly significnt ssocition btwn sctor nd diss. 38 How to comr th chnc of gtting diss btwn g 25 nd 2? St AGE SECTOR Constnt Vribls in th Eqution 95.% B S.E. Wld df Sig. EB Low.27.9 9.66.2.27. -.8.337 2.295..37. -.978.336 8.458.4.376. Vribls ntrd on st : AGE, SECTOR. Ag is lso significnt vribl, by controlling th sctor vribl, with -vlu of.2. EB=.27 mns th odds of gtting diss incrss s th g incrss. 39 St AGE SECTOR Constnt. Vribls ntrd on st : AGE, SECTOR. Vribls in th Eqution B S.E. Wld df Sig. EB Lowr Ur.27.9 9.66.2.27..45 -.8.337 2.295..37.59.594 -.978.336 8.458.4.376 For 25 yr old, controlling th sctor vribl, th odds r.978.8 sctor +.2725 for gtting th diss. For 2 yr old, controlling th sctor vribl, th odds r.978.8 sctor +.272 for gtting th diss. Th odds rtio would b.978.8 sctor +.27 25.978.8 sctor +.27 2 95.% C.I.for EXPB =.964/.76 =.45. This mns tht th odds of gtting diss for 25 yr-old is.45 tims highr thn th 2 yr-old. 4 Hosmr-Lmshow Tst cn b usd for tsting goodnss of fit. St Hosmr nd Lmshow Tst Chi-squr df Sig..853 8.2 -vlu =.2 >.5, imlis good fit. *On cn lso tst for intrctions btwn ll th vribls. 4 Eml: Low birth wighty, rity or th first born childx, nd smokingx 2. Emining th ssocition btwn low birth wight nd rity nd smoking vribls. Low Birth Wight Smoking Ys No Totl Prity Ys Ys 7 32 49 No 9 94 23 Totl 26 326 352 Prity No Ys 39 5 No 4 74 78 Totl 5 33 328 Prity Ys mns tht th child ws th first born of th mothr nd Prity No mns it ws not th first born of th mothr. 42 LR - 7
Logistic Rgrssion Modl without intrction: ln 2 2 Vribl vlus: Low Birth Wight: Low birth wight: y = ; High birth wight: y =. 22 22 Prity: Ys: = ; No: =. Smoking: Ys: 2 = ; No: 2 =. or SPSS Outut St PARITY SMOKE Constnt Vribls in th Eqution B S.E. Wld df Sig. EB.554.337 2.72..74.96.346.36.2 2.993-3.673.359 4.833..25. Vribls ntrd on st : PARITY, SMOKE. Intrrttion: Smoking is significnt in rdicting th robbility of low birth wight bby with -vlu of.2. Prity is not significnt with -vlu of.. Mimum liklihood stimts: 3.673, β.554, 2.96 43 44 Modl with intrction: ln 2 2 3 2 St PARITY SMOKE INTERACT Constnt Vribls in th Eqution B S.E. Wld df Sig. EB.7.6.323.25 2.7.236.595 4.36.38 3.44 -.24.732.86.77.87-3.772.56 55.67..23. Vribls ntrd on st : PARITY, SMOKE, INTERACT. Intrction is insignificnt -vlu =.77. It infltd th stndrd rror nd cn b limintd from th modl. 45 LR - 8